blktap2/vhd: add -liconv when linking if using libiconv
authorRoger Pau Monne <roger.pau@entel.upc.edu>
Tue, 20 Dec 2011 07:31:40 +0000 (08:31 +0100)
committerRoger Pau Monne <roger.pau@entel.upc.edu>
Tue, 20 Dec 2011 07:31:40 +0000 (08:31 +0100)
If libiconv is detected on the system add -liconv when linking the
libvhd library.

If -liconv is not added when compiling libvhd with libiconv the
following error occours when linking vhd-util and vhd-update:

gcc     -o vhd-util vhd-util.o -Llib -lvhd
lib/libvhd.so: undefined reference to `libiconv_open'
lib/libvhd.so: undefined reference to `libiconv_close'
lib/libvhd.so: undefined reference to `libiconv'

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/blktap2/vhd/lib/Makefile

index 97379c117e446633d976ee47a53f380f9113b7f7..b72e4d95659e9a196d007f81a8f03ad87d7d58af 100644 (file)
@@ -23,6 +23,10 @@ ifeq ($(CONFIG_Linux),y)
 LIBS            := -luuid
 endif
 
+ifeq ($(CONFIG_LIBICONV),y)
+LIBS            += -liconv
+endif
+
 LIB-SRCS        := libvhd.c
 LIB-SRCS        += libvhd-journal.c
 LIB-SRCS        += vhd-util-coalesce.c